package com.ruisoft.business.stock.bean;

import java.util.List;

import org.json.JSONObject;
import org.springframework.stereotype.Repository;

import com.ruisoft.base.dao.BaseDao;


public class StockPickingTypeDao extends BaseDao {

	/**
	 * 根据主键ID获取 stock picking type 业务对象
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public StockPickingType get(String id) throws Exception {
		String sqlid = "stock.select.pickingTypeById";
		List<JSONObject> stockPickingTypeList = queryId(id, sqlid);
		String str = stockPickingTypeList.get(0).toString();
        StockPickingType stockPickingType = (StockPickingType) net.sf.json.JSONObject.toBean(
				net.sf.json.JSONObject.fromObject(str), StockPickingType.class);
        System.out.println("转换后的值："+stockPickingType.toString());
		return stockPickingType;
	}

	/**
	 * 根据主键ID获取 stock picking type 业务对象
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Object getObject(String id) throws Exception {
		String sqlid = "stock.select.pickingTypeById";
		List<JSONObject> stockPickingTypeList = queryId(id, sqlid);
		String str = stockPickingTypeList.get(0).toString();
		return net.sf.json.JSONObject.toBean(
				net.sf.json.JSONObject.fromObject(str), Object.class);

	}
}
